package com.tedu.myblog.serviceImpl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.tedu.myblog.dao.TypeDao;
import com.tedu.myblog.entity.Type;
import com.tedu.myblog.service.TypeService;

/**
 * 
 * @author algh
 *
 */
@Service
public class TypeServiceImpl implements TypeService {
	@Autowired
	private TypeDao typeDao;

	@Transactional
	@Override
	public int saveType(Type type) {
		return typeDao.saveType(type);
	}

	@Transactional
	@Override
	public Type getType(Long id) {
		return typeDao.getType(id);
	}

	@Transactional
	@Override
	public List<Type> getAllType() {
		return typeDao.getAllType();
	}

	@Override
	public Type getTypeByName(String name) {
		return typeDao.getTypeByName(name);
	}

	@Transactional
	@Override
	public int updateType(Type type) {
		return typeDao.updateType(type);
	}

	@Transactional
	@Override
	public void deleteType(Long id) {
		typeDao.deleteType(id);
	}

}